// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Bar.js 1`] = `
var Bar = { x: 0 };
module.exports = Bar;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
var Bar = { x: 0 };
module.exports = Bar;

`;

exports[`copyProperties.js 1`] = `
// @flow

let tests = [
  // global
  function() {
    (copyProperties()); // error, unknown global
  },

  // annotation
  function(copyProperties: Object$Assign) {
    let result = {};
    result.baz = false;
    (copyProperties(
      result,
      { foo: 'a' },
      { bar: 123 }
    ): { foo: string, bar: number, baz: boolean });
  },

  // module from lib
  function() {
    const copyProperties = require('copyProperties');
    let x = { foo: 'a' };
    let y = { bar: 123 };
    (copyProperties({}, x, y): { foo: string, bar: number });
  },

  // too few args
  function(copyProperties: Object$Assign) {
    copyProperties();
    (copyProperties({ foo: 'a' }): { foo: number }); // err, num !~> string
  },

  // passed as a function
  function(copyProperties: Object$Assign) {
    function x(cb: Function) {}
    x(copyProperties);
  }
];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// @flow

let tests = [
  // global
  function() {
    copyProperties(); // error, unknown global
  },

  // annotation
  function(copyProperties: Object$Assign) {
    let result = {};
    result.baz = false;
    (copyProperties(result, { foo: "a" }, { bar: 123 }): {
      foo: string,
      bar: number,
      baz: boolean
    });
  },

  // module from lib
  function() {
    const copyProperties = require("copyProperties");
    let x = { foo: "a" };
    let y = { bar: 123 };
    (copyProperties({}, x, y): { foo: string, bar: number });
  },

  // too few args
  function(copyProperties: Object$Assign) {
    copyProperties();
    (copyProperties({ foo: "a" }): { foo: number }); // err, num !~> string
  },

  // passed as a function
  function(copyProperties: Object$Assign) {
    function x(cb: Function) {}
    x(copyProperties);
  }
];

`;

exports[`invariant.js 1`] = `
/* @flow */

let tests = [
  function() {
    let x: ?string = null;
    invariant(x, 'truthy only'); // error, forgot to require invariant
  },

  function(invariant: Function) {
    let x: ?string = null;
    invariant(x);
    (x: string);
  }
]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/* @flow */

let tests = [
  function() {
    let x: ?string = null;
    invariant(x, "truthy only"); // error, forgot to require invariant
  },

  function(invariant: Function) {
    let x: ?string = null;
    invariant(x);
    (x: string);
  }
];

`;

exports[`lib.js 1`] = `
declare module "copyProperties" {
  declare var exports: Object$Assign;
}

declare module "mergeInto" {
  declare var exports: $Facebookism$MergeInto;
}

declare module "mixin" {
  declare var exports: $Facebookism$Mixin;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
declare module "copyProperties" {
  declare var exports: Object$Assign;
}

declare module "mergeInto" {
  declare var exports: $Facebookism$MergeInto;
}

declare module "mixin" {
  declare var exports: $Facebookism$Mixin;
}

`;

exports[`mergeInto.js 1`] = `
// @flow

let tests = [
  // global
  function() {
    (mergeInto()); // error, unknown global
  },

  // annotation
  function(mergeInto: $Facebookism$MergeInto) {
    let result = {};
    result.baz = false;
    (mergeInto(result, { foo: 'a' }, { bar: 123 }): void);
    (result: { foo: string, bar: number, baz: boolean });
  },

  // module from lib
  function() {
    const mergeInto = require('mergeInto');
    let result: { foo?: string, bar?: number, baz: boolean } = { baz: false };
    (mergeInto(result, { foo: 'a' }, { bar: 123 }): void);
  },

  // too few args
  function(mergeInto: $Facebookism$MergeInto) {
    mergeInto();
  },

  // passed as a function
  function(mergeInto: $Facebookism$MergeInto) {
    function x(cb: Function) {}
    x(mergeInto);
  }
];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// @flow

let tests = [
  // global
  function() {
    mergeInto(); // error, unknown global
  },

  // annotation
  function(mergeInto: $Facebookism$MergeInto) {
    let result = {};
    result.baz = false;
    (mergeInto(result, { foo: "a" }, { bar: 123 }): void);
    (result: { foo: string, bar: number, baz: boolean });
  },

  // module from lib
  function() {
    const mergeInto = require("mergeInto");
    let result: { foo?: string, bar?: number, baz: boolean } = { baz: false };
    (mergeInto(result, { foo: "a" }, { bar: 123 }): void);
  },

  // too few args
  function(mergeInto: $Facebookism$MergeInto) {
    mergeInto();
  },

  // passed as a function
  function(mergeInto: $Facebookism$MergeInto) {
    function x(cb: Function) {}
    x(mergeInto);
  }
];

`;

exports[`test.js 1`] = `
var Bar = require('./Bar');
var mixin = require('mixin');

class Foo extends mixin(Bar) {
  m() {
    var x: string = this.x;
    this.y = "";
  }
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
var Bar = require("./Bar");
var mixin = require("mixin");

class Foo extends mixin(Bar) {
  m() {
    var x: string = this.x;
    this.y = "";
  }
}

`;
